package com.hc.mall.ware.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement
@MapperScan("com.hc.mall.ware.dao")
public class WareMyBatisConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor(){ //mybatis-plus分页插件
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setOverflow(true); //请求页码大于最大页是否回到首页
        paginationInterceptor.setLimit(1000); //每页最大条数
        return paginationInterceptor;
    }
}
